package com.tencent.sr.iris.basic.mp.service.activity;

import com.alibaba.fastjson.JSON;
import com.tencent.sr.iris.activity.interfaces.request.acticity.GetActivityConfigAwardRequest;
import com.tencent.sr.iris.activity.interfaces.response.activity.ActivityAwardInfoResponse;
import com.tencent.sr.iris.basic.mp.dependency.activity.ActivityConfigDependency;
import com.tencent.sr.iris.basic.mp.interfaces.request.MpGetActivityConfigAwardRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 活动配置
 *
 * @author nixiaolin
 */
@Service
@Slf4j
public class ActivityConfigService {

    @Resource
    private ActivityConfigDependency activityConfigDependency;

    /**
     * 查询活动奖励配置金额
     * @param request
     * @return
     */
    public ActivityAwardInfoResponse getConfigAwardInfo(MpGetActivityConfigAwardRequest request) {
        log.info("ActivityConfigService.getConfigAwardInfo request:{}", JSON.toJSONString(request));
        GetActivityConfigAwardRequest awardRequest = new GetActivityConfigAwardRequest();
        BeanUtils.copyProperties(request,awardRequest);
        ActivityAwardInfoResponse result = activityConfigDependency.getConfigAwardInfo(awardRequest);
        log.info("ActivityConfigService.getConfigAwardInfo response:{}", result);
        return result;
    }
}
